﻿#ifndef SMALLTOOL_H
#define SMALLTOOL_H

#include <QObject>
#include <QVariant>
#include <QDebug>
#include <QFile>
#include <QTextStream>
#include "common.h"

#include "./bin/popupControl.h"

class SmallTool : public QObject
{
    Q_OBJECT
public:
    explicit SmallTool(QObject *parent = nullptr);
    void parseFile(QString path);
    QString readFile(QString path);
    void writeFile(QString data, QString path);

    void createDynamicHeader();
    void checkPop();

signals:
    void sendParseResult(QVariant data);

public slots:
private:
    QVariantList _parseHeadMsgList;     //解析头文件得到结构体列表
    QVariantList _nameToIdList;              //结构体名映射id

    QString _start_flag;
    QVariantMap _msg;
    QVariantList _msgList;
    int _value;

    void process_line(QString line);
};
#endif // SMALLTOOL_H
